// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'

// 按需引入mint-ui
// import mint from './components/mint/index';
// Vue.use(mint);

//移动端适配兼容iPad，注意：npm下载的不兼容iPad
// import "./assets/js/lib-flexible";

//全局css
import animate from 'animate.css';
import "./assets/scss/common.scss";

//注册全局过滤器
import * as filters from './util/filter'
Object.keys(filters).forEach(k => Vue.filter(k, filters[k]));


//阻止生产提示
Vue.config.productionTip = false;


/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>',
  data:{
    qrcode_img:'',
    qrcode_url:'',
    code:'',
    webname:'',
    platform_type:'',
    loading:false,
    foot:true,
    isLogin:false,
    lotteryList:[],
    backData:[],
    noticeshow:false,
    path:'home',
    accountInit:{
      avatar:'',
      account_balance:0,
      user_account:'',
      user_name:'',
      phone_number:'',
      agent_id:0,
      agent_model:'',
      agent_type:0,
      account_type:0,
      current_statistics:0,
      domain_type:'',
      group_id:0,
      group_name:'',
      level:'',
      total_recharge:0,
    },
    kefu:'',
    cpInitInfo:{},
    currentCity:'',
  },
  beforeCreate() {

  },
  created(){
  },
  mounted(){

  },
  watch:{
  },
  methods:{

  }
});

//路由重定向
router.beforeEach((to, from, next) => {
  if (to.matched.length ===0) {
    from.name ? next({ name:from.name }) : next('/');
  } else {
    next();
  }
});
//路由切换后置顶
router.afterEach((to,from,next) => {
  window.scrollTo(0,0);
});
//解决ios不支持按钮:active伪类的方法
document.body.addEventListener("touchstart", function() {});
